import React from 'react';
import LmoNrcStore from './lmonrcStore';
import BacklogListPage from './backlogListPage';
import LmoSubmitPage from './lmoSubmitPage';
import LmoAuditPage from './lmoAuditPage';

function LmoBacklogHome({ navigation }) {
  const lmonrcStore = LmoNrcStore.useStore();
  const handleLmoView = (navkind, item) => {
    if (navkind === 'edit') {
      navigation.navigate(LmoSubmitPage.routeName, item);
    } else if (navkind === 'audit') {
      navigation.navigate(LmoAuditPage.routeName, item);
    }
  };
  return (
    <BacklogListPage
      getBacklogs={lmonrcStore.getLmoBacklogs}
      backlogList={lmonrcStore.lmoBacklogs}
      onBackLogView={handleLmoView}
    />
  );
}

LmoBacklogHome.routeName = 'LmoBacklogHome';
LmoBacklogHome.permission = 'RLmoBacklog';
export default LmoBacklogHome;
